<html>
<head>
    <meta charset="utf-8">
    <!-- <meta http-equiv="refresh" content="3"> -->
    <title>记录本-编辑</title>
    <link rel="stylesheet" id="t" href="/static/style/myFont.css">
    <link rel="stylesheet" href="/static/style/all.css">
    <link rel="icon" href="../../static/logo/index.png"  type="image/x-icon">
     <!-- <link rel="stylesheet" href="/static/style/wordEdite.css"> -->
     <script type="text/javascript" src="/static/js/jq.js"></script>
     <!-- <script type="text/javascript" src="/static/js/font.js"></script> -->
     <script type="text/javascript" >
        var head=document.getElementsByTagName('head')[0]
        var script=document.createElement("script")
        var link=document.createElement("link")
        //在电脑上是否打开手机模式
        var phone=0
        script.type="text/javascript"
        link.rel="stylesheet"
        if(isMobile())
        {
            script.src="/static/js/phone-wordEdite.js"
            link.href="/static/style/phone-wordEdite.css"
        }
        else
        {
            if(phone==0)
            {
               script.src="/static/js/wordEdite.js"
               link.href="/static/style/wordEdite.css"
            }
            else
            {
               script.src="/static/js/phone-wordEdite.js"
               link.href="/static/style/phone-wordEdite.css"
            }
            
            
        }
        head.appendChild(script)
        head.appendChild(link)

        function isMobile() 
         {
           const regExp = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
           return regExp.test(navigator.userAgent);
         }
     </script>
</head>
<body>
   <?php
        $cls=$_GET["cls"];
        $title=$_GET["title"];
        $subEd=$_GET["subEd"] ;
        $contents="<p><br></p>";
        if(strlen($subEd)==0)
        {
            $subEd="no";
        }
        $oDataFlag=$cls."#-#".$title;
        if(strlen($cls)!=0 and strlen($title)!=0)
        {
         $fileName="../../datas/contents/".$oDataFlag.".txt";
         $file=fopen($fileName, "r");
         $contents=fread($file,filesize($fileName));
        }
        
        echo "<input type='text' style='display:none;'  id='oDataFlag' value=$oDataFlag>";
        echo "<input type='text' style='display:none;'  id='contents' value='".htmlspecialchars($contents,ENT_QUOTES)."'>";

        echo "<input type='text' style='display:none;'  id='subEd' value=$subEd>";
        ?>
   
    
        <input type="text" style="display:none;"  id="oMedia"  value=[]>
   <div  id="box">
       <div  id="topBar">
                <div>
                    <a  href="/" class="index">导航</a>
                     <a  href="../../log.php" class="index">记录</a>
                    <a  href="wordEdite.php" class="enter">导入</a>
                </div>
              
           </div>
      <div id='iconBox'>
         <div id="minMax">
         <button class="fa fa-code  edit" id="showCode"></button>
         <button class="fa fa-rotate-left  edit" id="undo"></button>
         <button class="fa fa-rotate-right   edit" id="reundo"></button>
            <button class="fa fa-align-left  edit" id="left"></button>
         <button class="fa fa-align-center  edit" id="center"></button>
         <button class="fa fa-align-right  edit" id="right"></button>
         <button class="fa fa-align-justify  edit" id="justify"></button>
         <div class="fa edit" id="fontF"> 
            <button class="edit" id="fontFamily" >Aa</button>
            <div id="showF" style="display:none"></div>
         </div>
        
         <button class="th-font-size  edit  fa" id="fontSize"font><span id="tt"><span style="font-size:90%">T</span><span style="font-size:110%">T</span></span>
            <div id="showFontSize" style="display:none"><span type="text"  id="fontSizeNumber" >16px</span>
         <span id="addNumber">+</span><span id="subNumber">-</span>
            <input type="button" value="确定" id="fontSizeYes"></div></button>

         <div class="edit" id="ABackground"><button class="fa fa-palette"  id="ABackgrounIcon" ></button><input id="bColor" type="color" value="#d80e0e" style="display:none"></div>


        <span class="edit  fa" id="AColor"><button class="edit" id="AColorIcon">A</button><input type="color" id="fColor" value="#FFFF00" style="display:none"></span> 
         <div class="edit" id="showH"><button class="fa fa-header"  id="HIco"></button><div id="H"  style="display:none"></div></div>

         <div class="edit"><button class="fa fa-bold  upButton" id="bold" ></button><button class="downButton" id="unBold"></button></div>
         
          <div class="edit"><button class="fa fa-italic upButton" id="italic"></button><button class="downButton" id="unItalic"></button></div>

         <div class="edit"><button class="fa fa-underline upButton" id="underline"></button><button class="downButton" id="unUnderline"></button></div>

         <div class="edit"><button class="fa fa-strikethrough  upButton" id="strikethrough"></button><button class="downButton" id="unStrikethrough"></button></div>
        
         <button class="fa fa-brush   edit" id="brush"></button>
         <button class="edit fa fa-eraser " id="eraser"></button>
         <button class="fa fa-calendar-check edit" id="calendar"></button>

         
         <div id="addTable">
         <button class="fa fa-th  edit" id="tableB"></button>
            <div id="tableSetBox" style="display:none">
               <span id="tips" >行x列</span>
               <input id="setR" class="showInsert" value=3 ><input id="setC" class="showInsert" value=3>
               <button class="insert">+</button><button class="insert">+</button>
               <button class="insert">-</button><button class="insert">-</button>
               <button id="insertTableYes">确定</button>
                  <span class="showTipes">增或删行列</span>
               <button id="addC" class="editC ">+</button><button id="delC" class="editC">-</button>
               <span id="showTable"  readOnly="readOnly" disabled = true sytle="user-select: none">hxl</span>
               <button id="addR" class="editR">+</button><button id="delR" class="editR">-</button>
                    <span class="showTipes">修改行列宽度</span>
                <button id="addCW" class="editCW ">+</button><button id="delCW" class="editCW">-</button>
               <span id="shoW" readOnly="readOnly">hxl</span>
               <button id="addRW" class="editRW">+</button><button id="delRW" class="editRW">-</button>
            </div>
         </div>
         <button class="fa fa-copy   edit" id="copy"></button>
         <button class="fa fa-scissors edit" id="cut"></button>
         <button class="fa fa-paste   edit" id="paste"></button>
         <button class="fa fa-cloud-upload  edit" id="upload">
         </button>

         <button class="fa fa-save edit" id="saveData"></button>
         </div>
      </div>
      <!-- 显示状态 -->
       <div id="state"><input type="text" id="cls" placeholder="分类"><span id="stateWorder">状态:</span></div>


      <div id="text"  contenteditable="true" class="#divContainer#"><p><br></p></div>
      <!-- 文件上传显示框 -->
      <div id="showFile" style="display:none;top:170px;left:0px">
         <input type="file"  id="file" name="file"  value="0" style="display:none;">
         <div id="preview"><div class="SmediaBox"></div></div>
         <div id="uploadButton">
            <button  id="selectFile">文件</button>
            <button  id="uploadY">上传</button>
            <button id="uploadC">取消</button>
         </div>
      </div>
      <div id="showStates">78<div>
   </div>
</body>
</html>

